Replication files for "Endogenous treatment effect estimation with a large and mixed set of instruments and control variables." The .r files (R version 4.0.3 and later) implement the algorithm (R2IVE) proposed in Fan and Wu (2022). 

R2IVE_V1.r implement the first step nonparametric reduced form. 

R2IVE_V2.r implement the linear form for both structural and reduced form equations. besttuning.r is a function to choose tuning parameters. 

The user's manual (Manual.pdf) shows detailed step-by-step instructions for interested users of R2IVE. 

The data.csv is the data file to run the above R codes. 

For empirical example in Fan and Wu (2022), the main variables (data dictionary that defines each variable) can be found in R package naivereg: https://cran.r-project.org/web/packages/naivereg/index.html.

The GitHub website for R2IVE is https://github.com/microfan1/R2IVE